package org.jmat.batch.writer;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jmat.entities.Person;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemWriter;

public class PersonWriter implements ItemWriter{
	
	private final Log log = LogFactory.getLog(PersonWriter.class);

	public void clear() throws ClearFailedException {	
	}

	public void flush() throws FlushFailedException {	
	}

	public void write(Object obj) throws Exception {
		Person person = (Person)obj;
		if (log.isDebugEnabled()){
			log.debug("Person in progress : " + person.getId());
		}
		System.out.println(person.getId());
	}

}
